import canvasAbstract from "./canvasAbstract"
import model from "../model/player"
import config from "../../config";

class water extends canvasAbstract implements ICanvas {
  constructor() {
    super('play')
  }

  render(): void {
    this.createModels()
    super.renderModels()
  }

  model(): ModelConstructor {
    return model
  }

  num(): number {
    return 1
  }

  // 绘制模型
  protected createModels() {
    const position1 = {x: config.canvas.width / 2 + 2 *config.model.width, y: config.canvas.height - config.model.height}
    // const position2 = {x: config.canvas.width / 2 - 2 *config.model.width, y: config.canvas.height - config.model.height}
    const model = this.model() as ModelConstructor
    const instance1 = new model(position1)
    // const instance2 = new model(position2)
    this.models.push(instance1)
  }
}

export default new water()
